export const useAppContextJs = (apiItems: IApiItem[]) => {
    // 找一下，是否存在/api开头并/config结尾的api
    const configApi = apiItems.find((item) => item.url?.endsWith('/config'))
    let configUrl = '/api/act2025/testActivity/config'
    if (configApi && configApi.url) {
        configUrl = configApi.url
    }

    return `import { useRequestContext } from '@changba/funny'

/**
 * 获取活动引擎的后台配置
 */
export const useAppContext = useRequestContext({
	configURL: '${configUrl}',
	useEngine: true,
	// useLara: true,
	// useLink: true,
	// configService: 'MARIO',
	// onInit: (ctx) => {
	// 	ctx.mario.setBaseURL('${configUrl}')
	// },
})
`
}
